package com.example.cores_middle_activity;

import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class DrawableStatus extends AppCompatActivity implements CompoundButton.OnCheckedChangeListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_drawable_status);

        CheckBox checkboxCustom = findViewById(R.id.ck_custom);
        CheckBox checkboxSystem = findViewById(R.id.ck_system);

        checkboxCustom.setOnCheckedChangeListener(this);
        checkboxSystem.setOnCheckedChangeListener(this);
    }

    @Override
    public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
        String format = String.format("您%s", isChecked ? "已选择" : "未选择");
        compoundButton.setText(format);
    }
}